package Domain;

import Technical.Database;

public class Website {
    
	private Database db = new Database();
    private static Website web = new Website();
	
    private Website() {};
    
	public BlogBean getBlog(int id){
		return db.getBlog(id);
	}
    public Boolean userExists(String userName){
        return db.userExists(userName);
    }
    public static Website getInstance(){
        return web;
    }
    public void addNewUser(UserBean user){
        db.addNewUser(user);
    }
    public int getUserID(String userName){
        return db.getUserId(userName);
    }
	public void addNewPost(int userId, PostBean post){
		db.addNewPost(db.getBlogByUserId(userId), post);
	}
}
